/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author ramiro
 */
public class enviarmsj extends org.apache.struts.action.Action {

    /* forward name="success" path="" */
    private static final String SUCCESS = "success";

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param form The optional ActionForm bean for this request.
     * @param request The HTTP Request we are processing.
     * @param response The HTTP Response we are processing.
     * @throws java.lang.Exception
     * @return
     */
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
       // String Box = request.getParameter("Box");
       //  String name = request.getParameter("username");
      //  Enviar a       = new Enviar();
        String smtp    = "smtp.gmail.com";
        String From    = "alemartini2204@gmail.com";
        String infor   = "caricuao";
        String To       = "ramiro_darkness2117@hotmail.com";
        String To1      = "ramiro_darkness2117@hotmail.com";
        String To2      = "ramiro_darkness2117@hotmail.com";
        String To3      = "ramiro_darkness2117@hotmail.com";

        String asunto  = "mensaje recordatorio";
        String mensaje = "saludando a la persona xxx";
           /*
        if (Box.equals("Todos")){
            Enviar.send(smtp,From,infor,To,asunto,mensaje);
            Enviar.send(smtp,From,infor,To1,asunto,mensaje);
            Enviar.send(smtp,From,infor,To2,asunto,mensaje);
            Enviar.send(smtp,From,infor,To3,asunto,mensaje);
        }
        else if (Box.equals("DACE")){
            Enviar.send(smtp,From,infor,To,asunto,mensaje);
        }
        else if (Box.equals("DIDE")){
            Enviar.send(smtp,From,infor,To1,asunto,mensaje);
        }else if (Box.equals("DII")){
            Enviar.send(smtp,From,infor,To2,asunto,mensaje);
        }else if (Box.equals("CPyD")){
            Enviar.send(smtp,From,infor,To3,asunto,mensaje);
        }
        */
        return mapping.findForward(SUCCESS); 
    
    }
}

